/*
 * @Author: Pabin <pabin_pluto@foxmail.com>
 * @Date: 2024-01-07 13:14:04
 * @LastEditors: Pabin <pabin_pluto@foxmail.com>
 * @LastEditTime: 2024-01-09 14:35:37
 * @FilePath: \ecg 4.0\mcu\Sources\heartrate.h
 * @Description: 
 * 
 * Copyright (c) 2024 by Pabin, All Rights Reserved. 
 */
#ifndef HEARTRATE_H_
#define HEARTRATE_H_

#include "common.h"

#define INIT_TH_TEART 7000
#define buztip_drv DDRJ_DDRJ0
//#define buztip_drv PORTB_PB1

extern short samplespeed;
extern short old_data;
extern short heart_counter_flag;
extern short heart_counter;
extern uint16_t heartrate;
extern short heartrate_old;
extern short buztip_counter;
extern short th_heart;
extern short peak_find_flag;
extern short peak_max_val;


extern byte buztip_en;

void Heart_Peak_Buztip(short data);

void heart_count(void);

void buztip_count(void);

void peak_max_find(short data);

void show_peak(void);


#endif /* HEARTRATE_H_ */